<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\DorminfoModel */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="dorminfo-model-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'stu_id')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'dorm_area')->textInput()->dropDownList(['0'=>'东校园','1'=>'西校园','2'=>'西校园南区']) ?>

    <?= $form->field($model, 'dormitory')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'dorm_num')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'live_time')->textInput(['maxlength' => true])->dropDownList([(date('Y').'-'.(date('Y')+1))=>(date('Y').'-'.(date('Y')+1)),
    																						((date('Y')-1).'-'.date('Y'))=>((date('Y')-1).'-'.date('Y')),
    																						((date('Y')-2).'-'.(date('Y')-1))=>((date('Y')-2).'-'.(date('Y')-1)),
    																							((date('Y')-3).'-'.(date('Y')-2))=>((date('Y')-3).'-'.(date('Y')-2))]) ?>

   
   <?php   $model->leader =  explode(',',$model->leader); //本句用法参见附录A第2篇文章
          echo  $form->field($model, 'leader')->checkboxList(['宿舍长'=>'宿舍长','楼层长'=>'楼层长','楼栋长'=>'楼栋长'],['unselect'=>'无',
																											'class'=>'hahah1',
																												'id'=>666,	
          																												] ) ?>
   
   

    <div class="form-group">
        <?= Html::submitButton('修改',['class'=>'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
